package com.bjsxt.feign;

import com.bjsxt.config.feign.OAuth2FeignConfig;
import com.bjsxt.dto.CoinDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description:
 * OpenFeign 远程调用 finance-server 的 http 接口
 *
 * @author ALIENWARE
 * @version v1.0.0
 * @create 06/01/2024
 **/
@FeignClient(name = "finance-server", contextId = "CoinFeignClient", configuration = OAuth2FeignConfig.class, path = "/coins")
public interface CoinFeignClient {
    /**
     * 根据 ID 集合查询币种数据
     *
     * @param ids id 集合
     * @return 返回的币种信息集合
     */
    @GetMapping("/getByIds")
    public List<CoinDto> getByIds(@RequestParam(name = "ids") List<Long> ids);
}
